﻿using BwTMusicServices.Album;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace BwTMusic.Controllers
{
    public class AlbumController : Controller
    {
        AlbumServices album = new AlbumServices();
        // GET: Album
        public ActionResult AlbumList()
        {
            string id = Request.QueryString["id"];
            TempData["albumId"] = id;
            ViewData["albumId"] = id;
            return View();
        }
        public JsonResult GetAlbumInfo()
        {
            return Json(new { data = album.GetAlbumInfo(TempData["albumId"].ToString()), statusCode = 1, message = "查询成功", success = true }, JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAlbumMusicLists(int CurrentPage, int AlbumId)
        {
            return Json(new { data = album.GetAllNorthAlbumMusic(CurrentPage, AlbumId, out int total), statusCode = 1, message = "查询成功", success = true, totalCount = total }, JsonRequestBehavior.AllowGet);
        }
    }
}